var t = require;
var e = module;
var o = exports;
var i, n = this && this.__extends || (i = function(t, e) {
    return (i = Object.setPrototypeOf || {
        __proto__: []
    }
    instanceof Array &&
    function(t, e) {
        t.__proto__ = e
    } ||
    function(t, e) {
        for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o])
    })(t, e)
},
function(t, e) {
    function o() {
        this.constructor = t
    }
    i(t, e),
    t.prototype = null === e ? Object.create(e) : (o.prototype = e.prototype, new o)
}),
a = this && this.__decorate ||
function(t, e, o, i) {
    var n, a = arguments.length,
    r = a < 3 ? e: null === i ? i = Object.getOwnPropertyDescriptor(e, o) : i;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, i);
    else for (var s = t.length - 1; s >= 0; s--)(n = t[s]) && (r = (a < 3 ? n(r) : a > 3 ? n(e, o, r) : n(e, o)) || r);
    return a > 3 && r && Object.defineProperty(e, o, r),
    r
};
Object.defineProperty(o, "__esModule", {
    value: !0
});
var r = t("Util"),
s = t("Global"),
l = t("GatlinHitEffect"),
c = t("WeaponControl"),
d = cc._decorator,
h = d.ccclass,
p = d.property,
u = function(t) {
    function e() {
        var e = null !== t && t.apply(this, arguments) || this;
        return e.pfb_hitEff = null,
        e.node_light = null,
        e._gameControl = null,
        e.explode = function() {
            if (e.weaponCrol) {
                e.weaponCrol.mineBlowOff(e.node.convertToWorldSpaceAR(cc.Vec2.ZERO));
                var t = r.Util.objectPool.getNodeFromNodePool(s.PoolKey.GrenadeHitEff, e.pfb_hitEff);
                e.node.parent.parent.addChild(t),
                t.setPosition(e.node.parent.position),
                t.getComponent(l.default).init(s.PoolKey.GrenadeHitEff),
                e.unschedule(e.playSound),
                r.Util.objectPool.putNodeIntoNodePool(s.PoolKey.mine, e.node.parent)
            }
        },
        e.playSound = function() {
            e.node_light.active = !1,
            e.scheduleOnce(function() {
                e.node_light.active = !0
            },
            .15),
            e._gameControl.playSound(e._gameControl._audioControl.warnning)
        },
        e
    }
    return n(e, t),
    e.prototype.init = function(t) {
        var e = this;
        this._gameControl || (this._gameControl = t, this._gameControl.playSound(this._gameControl._audioControl.btn_click)),
        this.node.getComponent(cc.Collider).enabled = !1,
        this.isExp = !1,
        this.scheduleOnce(function() {
            e.isExp = !0,
            e.node.getComponent(cc.Collider).enabled = !0
        },
        3)
    },
    e.prototype.onCollisionEnter = function(t) {
        this.isExp && (this.isExp = !0, this.weaponCrol = t.node.getComponent(c.default), this.schedule(this.playSound, .2), this.scheduleOnce(this.explode, 1))
    },
    a([p(cc.Prefab)], e.prototype, "pfb_hitEff", void 0),
    a([p(cc.Node)], e.prototype, "node_light", void 0),
    a([h], e)
} (cc.Component);
o.default = u